//
//  PowerCell.m
//  MoXiProject
//
//  Created by 周筱雯 on 2017/6/30.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "PowerCell.h"
#import "GreatGodModel.h"

@interface PowerCell()
@property (weak, nonatomic) IBOutlet UIImageView *powerImg;
@property (weak, nonatomic) IBOutlet UILabel *powermingci;
@property (weak, nonatomic) IBOutlet UILabel *powerName;
@property (weak, nonatomic) IBOutlet UILabel *poweryingli;
@property (weak, nonatomic) IBOutlet UILabel *powermingz;

@end

@implementation PowerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.powerImg.layer.cornerRadius = self.powerImg.width / 2;
    self.powerImg.layer.masksToBounds = YES;
}

-(void) setPowerCellDataSource:(GreatGodModel *) greatModel index:(NSIndexPath *) indexPath{

    [self.powerImg sd_setImageWithURL:[NSURL URLWithString:greatModel.greatimgPath] placeholderImage:DEF_NORMAL_DEFAULT_IMAGE];
    [self.powerName setText:greatModel.greatusername];
    [self.powermingci setText:[NSString stringWithFormat:@"%ld",(long)indexPath.row + 1]];
    [self.poweryingli setText:[NSString stringWithFormat:@"盈利率：%.2f%%",[greatModel.greatearnRate floatValue]]];
    [self.powermingz setText:[NSString stringWithFormat:@"命中率：%.2f%%",[greatModel.greathitRate floatValue]]];
    
//    NSLog(@"%.2f",[greatModel.greathitRate floatValue]);
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
